﻿
function add() {
  var div = document.getElementById("fileUpload");
  var count = div.childNodes.length

  var input = document.createElement('input');
  input.name = 'FileUpload' + (count / 2 + 1);
  input.type = 'file';
  var br = document.createElement('br');

  div.appendChild(input);
  div.appendChild(br);
}

function remove() {
  var div = document.getElementById("fileUpload");
  var count = div.childNodes.length
  if (count == 0)
    return;
  div.removeChild(div.childNodes[count - 1]);
  div.removeChild(div.childNodes[count - 2]);
}
